package com.itheima.controller;


import com.itheima.pojo.*;
import com.itheima.server.INursingPlanService;
import jakarta.servlet.http.HttpServletResponse;
import lombok.extern.java.Log;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.web.bind.annotation.*;

import java.util.List;


@RestController
@RequestMapping("/Plan")
public class NursingPlanController
{
    @Autowired
    private INursingPlanService nursingPlanService;


    @GetMapping("/list")
    public Result list(NursingPage nursingPage){
        PageResult<NursingPlan> pageResult=nursingPlanService.getList(nursingPage);
        return Result.success(pageResult);
    }
    @PostMapping("/add")
    public Result add(@RequestBody NursingPlanDto dto){
        return Result.success(nursingPlanService.insertNursingPlan(dto));

    }











}
